package com.edu.javaweb.mapper;

import com.edu.javaweb.pojo.StuClass;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StuClassMapper {
    @Select("select * from stuclass")
    List<StuClass> findAll();
    @Insert("insert into stuclass values (null,#{name},#{grade},#{specialized})")
    void insClass(StuClass stuClass);

    @Update("update stuclass set name=#{name},grade=#{grade},specialized=#{specialized} where id=#{id}")
    void upClass(StuClass stuClass);

    @Delete("delete from stuclass where id=#{id}")
    void delById(Integer id);
}
